Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enh: Update Predibase integration to support v2 API #403

Merged
merged 5 commits into from
Apr 11, 2024

Conversation

jeffreyftang
Copy link
Contributor

Predibase is releasing a new API for working with and retrieving adapters. This PR updates Lorax's Predibase integration to prefer the new API, falling back to the legacy endpoints to maintain backwards compatibility during the transition period.

raise RuntimeError(f"Adapter {model_id} is not yet available")
return path
else:
# Use legacy path only since new endpoint requires both name and version number.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this code is identical to 54:58. Can we pull it into a function?

def fetch_legacy_url(legacy_url):
    resp = requests.get(legacy_url, headers=headers)
    resp.raise_for_status()
    uuid, best_run_id = resp.json()["uuid"], resp.json()["bestRunID"]
    return f"{uuid}/{best_run_id}/artifacts/model/model_weights/"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

return f"{uuid}/{best_run_id}/artifacts/model/model_weights/"

if url is not None:
try:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just trying to think about this in terms of customer impact: we really only expect staging to use this for the next few days until we migrate all of LLM Models to the Adapters table and a very brief window in Prod while we migrate the data right?

Copy link
Contributor

@tgaddair tgaddair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jeffreyftang jeffreyftang merged commit ce501cd into main Apr 11, 2024
1 check passed
@jeffreyftang jeffreyftang deleted the pbase-integration-update branch April 11, 2024 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants